package com.lifa.controller;


import com.lifa.dao.KucunpandiantongjiDao;
import com.lifa.entity.Kucunpandiantongji;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

@Controller
@RequestMapping("/pandian")
@Scope("prototype")
public class KucunpandiantongjiController {
    @Autowired
    private KucunpandiantongjiDao kucunpandiantongjiDao;
    @RequestMapping("/pandianchaxuen")
    @ResponseBody
    public List<Kucunpandiantongji> kucunpandiantongji1(){
        return kucunpandiantongjiDao.pandian();
    }
    @RequestMapping("/pandianfenye1")
    @ResponseBody
    public Map<String,Object> neitiaofenye1(String username, int offset, int limit ){
        Map<String,Object> map=new HashMap<>();
        map.put("rows",kucunpandiantongjiDao.kucunpandianfenye(username,offset,limit));
        map.put("total",kucunpandiantongjiDao.kucunpandianzongtiaoshu(username));
        return map;
    }
}
